<tagLib name="html" />
<include file="Public:headerNew" />
<load href="__PUBLIC__/Js/jqueryUI/jquery-ui-1.8.16.custom.min.js" />
<load href="__PUBLIC__/Css/jqueryUI/jquery-ui-1.8.21.custom.css" />
<load href="__PUBLIC__/Js/Jquery/jquery.form.js" />
<load href='__PUBLIC__/Js/listtolist.js'/>
<div class="titleone"><h1 class="fLeft">修改商业用户信息</h1><a href="__URL__"><div class="returnimg"></div></a></div>
<div id="result" class="result none"></div>

		<script type="text/javascript">
			$(function(){
	       		$('#form1,#from2').ajaxForm({
						type: 'POST',
									
						beforeSubmit:  checkForm,  // pre-submit callback
						
						success:       complete,  // post-submit callback
						
						dataType: 'json'
				
				});
					
		
		        
				function checkForm(){

							if( '' == $.trim($('#name').val())){
											
									$('#result').html('名字不能为空').show();
							
											return false;
							
							}
							


							

								
							//可以在此添加其它判断
		
						}
							
				function complete(data){
						
							if (data.status==1){
						
										$('#result').html(data.info).show();
						
										// 更新列表
						
										data = data.data;
						
									}else{
						
										$('#result').html(data.info).show();
						
									}
			 } 
			
			//多标签
			$( "#tabs" ).tabs();
			
			$('body').addClass('has-js');
			 $('.label_check,.label_radio').click(function(){ setupLabel(); });
			  setupLabel();
			
				

			});
			function submitForm() { 
									// inside event callbacks 'this' is the DOM element so we first 
									// wrap it in a jQuery object and then invoke ajaxSubmit 
						$(this).submit();
       					return false;	
								
   			};
			
			
			
function getZonsList(obj){
				var t_url="{:U('getZoneList?pid=')}"+$("#zoneid").val();

				$.ajax({
						url: t_url,
						type: 'GET',
						dataType: 'json',
						error: function(){
							alert('Error loading XML document');
						},
						success: function(data, textStatus){
							var json = eval(data['data']);
							$('#fselect').empty();
							if (json!=null){
							
							json.sort(function(a,b){
    								return a.id-b.id;
							});
						    for (var ind in json) {
								str = padRight(json[ind].name,24).replace(/\^/g,"&nbsp;");
							 	 $('#fselect').append('<option value="' + json[ind].id + '">'+ str + '面积:'+json[ind].place+']</option>');
								 //对面积数据数组赋值
									var itemx= new Array();
									itemx[0]=json[ind].id;
									itemx[1]=json[ind].name;
									itemx[2]=json[ind].place;
									
	                		}
							}
						}
				});
} 
			
			
			
</script>

<div id="main" class="main full" >
<div class="metroTitle">修改商业机构信息</div>	
<br/>	
<form method='post'  name='form1' id='form1' action='__URL__/update' enctype="multipart/form-data">
<span class="comtitle">{$com.name}</span>


<div id="tabs">
	<ul>
		<li><a href="#tabs-1">基本信息</a></li>
		<li><a href="#tabs-2">面积信息</a></li>
		<li><a href="#tabs-3">授权信息</a></li>
	</ul>
	<div id="tabs-1" style="height:460px;">
     <div style="height:415px">
	  <table width="98%" border="0">
      <tr>
    <td width="160" class="tRight">商户名称:</td>
    <td><input type="text" size="40" id="name" value="{$com.name}" class="metro medium bLeftRequire" style="width:300px;" /></td>
  </tr>
  <tr>
  <td height="20" class="tRight">状态：</td>
  <td class="tLeft">
  <select name="status" class="metro medium bLeftRequire" style="width:310px;">
    <option <eq name="vo.status" value="1" >selected</eq> value="1">启用</option>
	<option <eq name="vo.status" value="0" >selected</eq> value="0">禁用</option>
    </select>
    
    </td>
</tr>
  <tr>
    <td width="160" class="tRight">描述:</td>
    <td><TEXTAREA  name="remark"  ROWS="5" COLS="57" id="remark" class="metro medium bLeftRequire" style="width:300px;">{$com.remark}</TEXTAREA></td>
  </tr>
  <tr>
    <td width="160" class="tRight">地址:</td>
    <td class="tLeft">
	  <textarea  name="address"  rows="3" cols="57" id="address" class="metro medium bLeftRequire" style="width:300px;">{$com.address}</textarea>
	</td>
  </tr>
  <tr>
    <td class="tRight">联系人信息:</td>
    <td class="tLeft"><input type="text" class="metro medium bLeftRequire"  name="contact"  id="contact" value="{$com.contact}" style="width:300px;"/></td>
  </tr>
  <tr>
    <td class="tRight">联系电话:</td>
    <td class="tLeft"><input type="text" class="metro medium bLeftRequire"  name="tel" id="tel" value="{$com.tel}" style="width:300px;"/></td>
  </tr>
      </table>
  </div>    
     <div class="toolPanel">
        <div style="width:95%;margin:5px">
            <input type="hidden" name="step" value="1">
            <input type="hidden" name="id" value="{$com.id}">
            <div class="impBtnN fRig"><a href="#" onclick="submitForm();" id="buttonSaveBlock" ></a></div>
          
        </div>
    </div>     
</form>      
	</div>
	<div id="tabs-2" style="height:460px;">
    <form method='post' id='form2' action='__URL__/updateBiz' enctype="multipart/form-data">
    <div style="height:415px">
	    <table width="98%" border="0" cellspacing="3" cellpadding="3">
		   <tr>
		     <td class="tRight" width="160">物业使用面积：</td>
		     <td class="tLeft"><input  name="znum" type="text" class="metro" id="znum" style="width:300px;" value="{$com.znum}"/></td>
		     <td class="tRight">采暖使用面积：</td>
		     <td class="tLeft"><input  name="znum2" type="text" class="metro" id="znum2" style="width:300px;" value="{$com.znum2}"/></td>
	      </tr>
		   <tr>
		     <td class="tRight" width="160">所在小区：</td>
		     <td class="tLeft"><html:select name="zoneid" id="zoneid" change="getZonsList(this)"  first="选择区域" options="zonesList" selected="selectid" style="metro" /></td>
		     <td class="tRight" width="160">&nbsp;</td>
		     <td width="345" class="tLeft">&nbsp;</td>
	      </tr>
		   <tr>
		     <td height="144" align="center">&nbsp;</td>
		     <td height="144" colspan="3" class="tLeft"><table width="100%" border="0" cellspacing="0" cellpadding="0">
		       <tr>
		         <td>商网列表</td>
		         <td width="40">&nbsp;</td>
		         <td class="tLeft">已选商网</td>
	            </tr>
		       <tr>
		         <td><select name="fselect" size="8" multiple="multiple" id="fselect" style="width:220px" class="metro">
		           <volist name="zonesList" id="vo">
		             <option value="{$vo.id}">{$vo.name}&nbsp;&nbsp;&nbsp;&nbsp;[面积:{$vo.place}]</option>
		             </volist>
		           </select></td>
		         <td><div id="moveright">&gt;&gt;</div>
		           <br/>
		           <div id="moveleft">&lt;&lt;</div></td>
		         <td class="tLeft"><select name="tselect" size="8" multiple="multiple" id="tselect" style="width:220px" class="metro">
		           <volist name="mPlaceList" id="vo">
		             <option value="{$vo.id}">{$vo.name}&nbsp;&nbsp;&nbsp;&nbsp;[面积:{$vo.place}]</option>
		             </volist>
		           </select></td>
	            </tr>
		       </table></td>
	      </tr>
	    </table>
	    <script language="javascript">getZonsList($('#zoneid'));

         </script>
         </div>
  <div class="toolPanel">
        <div style="width:95%;margin:5px">
            <input name="step" type="hidden" id="step" value="2">
            <input type="hidden" name="id" value="{$com.id}">
           <input type="hidden" name="ids" id="ids" value="{$ids}" />
            
            <div class="impBtnN fRig"><a href="#" onclick="submitForm();" id="buttonSaveBlock" ></a></div>
          
        </div>
    </div>            
         </form>
	</div>
    
	<div id="tabs-3" style="height:460px;">
   <script language="javascript">
    function setupLabel(){ if($('.label_check input').length) { 
		$('.label_check').each(function(){ $(this).removeClass('c_on'); });
		 $('.label_check input:checked').each(function(){ $(this).parent('label').addClass('c_on'); }); }; 
		 if($('.label_radio input').length) { $('.label_radio').each(function(){ $(this).removeClass('r_on'); });
		  $('.label_radio input:checked').each(function(){ $(this).parent('label').addClass('r_on'); }); }; 
	}
   </script>
<form method='post' id='form2' action='__URL__/updateBiz' enctype="multipart/form-data">    
 <div style="height:415px">     
	  <fieldset class="checkboxes">
      <table width="900" border="0">
		  <tr>
		    <td width="150"><label for="checkbox-01" class="label_check"> <input type="checkbox" checked="true" value="1" id="checkbox-01" name="sample-checkbox-01" />水费 </label></td>
		    <td width="150"><label for="checkbox-02" class="label_check"> <input type="checkbox" checked="true" value="1" id="checkbox-02" name="sample-checkbox-02" />电费</label> </td>
		    <td width="150"><label for="checkbox-03" class="label_check"> <input type="checkbox" checked="true" value="1" id="checkbox-03" name="sample-checkbox-03" />物业费</label> </td>
		    <td width="150"><label for="checkbox-04" class="label_check"> <input type="checkbox" checked="true" value="1" id="checkbox-04" name="sample-checkbox-04" />污水处理费</label></td>
		    <td width="150"><label for="checkbox-05" class="label_check"> <input type="checkbox" checked="true" value="1" id="checkbox-05" name="sample-checkbox-05" />采暖费</label></td>
		    <td width="150">&nbsp;</td>
	    </tr></table>
      </fieldset><br />
      <table width="98%" cellpadding="3" cellspacing="3" >
        <tr>
          <td class="tRight"  width="160" height="20">水费单价</td>
          <td class="tLeft"><input type="text" class="metro medium bLeftRequire"  name="w_price"  id="w_price" value="{$com.w_price}"/></td>
          <td class="tRight"  width="160" height="22">电费单价</td>
          <td class="tLeft"><input type="text" class="metro medium bLeftRequire"  name="e_price"  id="e_price" value="{$com.e_price}"/></td>
        </tr>
        <tr>
          <td class="tRight"  width="160" height="20">污水处理费单价</td>
          <td class="tLeft"><input type="text" class="metro medium bLeftRequire"  name="ww_price"  id="ww_price" value="{$com.ww_price}"/></td>
          <td class="tRight"  width="160" height="22">采暖费单价</td>
          <td class="tLeft"><input type="text" class="metro medium bLeftRequire"  name="h_price"  id="h_price" value="{$com.h_price}"/></td>
        </tr>
        <tr>
          <td height="20" class="tRight">物业费单价</td>
          <td class="tLeft"><input type="text" class="metro medium bLeftRequire"  name="p_price"  id="p_price" value="{$com.p_price}"/></td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
      </table>
 </div>
  <div class="toolPanel">
        <div style="width:95%;margin:5px">
            <input name="step" type="hidden" id="step" value="3">
            <input type="hidden" name="id" value="{$com.id}">
            <div class="impBtnN fRig"><a href="#" onclick="submitForm();" id="buttonSaveBlock" ></a></div>
          
        </div>
    </div>      
      
   </form>   
	</div>
</div>




		


